package com.gem.growingtree.bodyline;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class MyDatabaseHelper extends SQLiteOpenHelper {

	private static final String CREATE_TABLE_SQL = "create table body_info(_id integer primary key autoincrement,body_x int,body_y REAL)";
	private final static int VERSION = 1;
	private final static String NAME = "body.db3";

//	public MyDatabaseHelper(Context context, String name, int version) {
//		super(context, name, null, version);
//
//	}
	public MyDatabaseHelper(Context context, String name,
			CursorFactory factory, int version) {
		super(context, name, factory, version);
		// TODO Auto-generated constructor stub
	}

	public MyDatabaseHelper(Context context) {
		super(context, NAME, null, VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		// TODO Auto-generated method stub
		db.execSQL(CREATE_TABLE_SQL);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub
		db.execSQL("drop database if exists "+NAME);
        onCreate(db);
	}

}
